package my.study.java.lang.reflect.Method.examples;

import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;

public class Introduction {
	public void set(boolean i) {

	}

	public void set2(Boolean i) {

	}

	private static char ch = 'a';

	/**
	 * erjoi
	 * 
	 * @param args
	 */
	public static void main(String[] args) {
		Class<?> arraylist = Introduction.class;
		printMethod(arraylist);
	}

	public static void printMethod(Class<?> c) {
		Method[] methods = c.getDeclaredMethods();
		for (Method method : methods) {
			ch = 'a';
			p(Modifier.toString(method.getModifiers()) + " "
					+ method.getReturnType().getSimpleName() + " "
					+ method.getName());
			p("(");
			Class<?>[] cls = method.getParameterTypes();
			if (cls.length >= 1) {
				p(cls[0].getName() + " " + (ch++));

				for (int i = 1; i < cls.length; i++) {
					p(", ");
					p(cls[i].getName() + " " + (ch++));
				}
			}

			pl(")");
			pl(method);
		}
	}

	public static void pl(Object o) {
		System.out.println(o);
	}

	public static void p(Object o) {
		System.out.print(o);
	}
}
